home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / logins / logrun / logrun.doc < prev   
Text File  |  1996-07-10  |  6KB  |  110 lines

  1.        ╔══════════════════════════════════════════════════════════════╗
  2.        ║                             LOGRUN                           ║
  3.        ╟──────────────────────────────────────────────────────────────╢
  4.        ║                                                              ║
  5.        ║            Novell NetWare Login Utility for Menuing          ║
  6.        ║                       By Dave Frailey                        ║
  7.        ║                                                              ║
  8.        ╚══════════════════════════════════════════════════════════════╝
  9.  
  10.                                 INTRODUCTION
  11. ───────────────────────────────────────────────────────────────────────────────
  12. A lot of network administrators like to have a menu program run automatically
  13. after a user logs in.  The natural place to ensure this happens is in the
  14. system login script.  However, what a lot of administrators don't realize is
  15. that the login script is actually executed by the LOGIN program, ON THE REMOTE
  16. COMPUTER, when a user logs in.  The LOGIN program requires and allocates about
  17. 80k of memory to perform this function.  The problem with the system login
  18. script just going out and running your favorite menuing software is that the
  19. LOGIN program has 80k of memory tied up at this point.  What's even worse is
  20. if the login script loads a Terminate and Stay Resident (TSR) program which
  21. then permamently "sandwiches" LOGIN.EXE's memory, rendering it useless even
  22. after everything is said and done, because memory is allocated in contiguous
  23. blocks.
  24.  
  25. Novell's theory on how to have the login script run your menuing software is
  26. to use the EXIT login script command specifying the name of the menu program
  27. to run.  What the EXIT command then does is stuff the name of the menu program
  28. into the keyboard queue, assuming that LOGIN.EXE was run from the dos command
  29. prompt so that the name of the menu program would then come out of the keyboard
  30. queue, as if the user had typed it, and the menu program would then run.  What
  31. happens however, if the LOGIN program isn't run from the Dos command line?
  32. Well LOGIN.EXE doesn't know any better and goes ahead and stuffs the keyboard
  33. queue, based on the EXIT instruction in the login script, with the name of the
  34. menu program, and control then returns to the shell that ran LOGIN.  Well what
  35. if the characters comprising the name of the menu program were also the same
  36. sequence of keys to delete a file?
  37.  
  38. The only solid way to run a program after Novell's LOGIN.EXE program terminates
  39. is to trap control of the computer at the point where LOGIN.EXE is about to
  40. return control to the previous program, and then run the program you want run.
  41.  
  42. The answer to this situation is LOGRUN.  What LOGRUN does is install itself
  43. temporarily as a TSR, directly above the memory in use by LOGIN.  LOGRUN also
  44. chains itself into the MS-Dos Function Request Dispatcher interrupt vector so
  45. it can determine when LOGIN.EXE is about to exit.  After LOGRUN is installed,
  46. it sits dormantly, waiting for LOGIN.EXE to exit.  In the mean time the login
  47. script can go on and do any number of things, including running other external
  48. programs.  When LOGIN.EXE is about to exit, LOGRUN takes control, releasing
  49. all of LOGIN.EXE's memory and closing all of its files.  LOGRUN then shifts
  50. itself down to the start of memory from which LOGIN.EXE was running and also
  51. releases the memory it was temporarily using.  Then, LOGRUN resizes the block
  52. of memory it is occupying down to just enough to hold LOGRUN's resident code
  53. (less than 100 bytes) and executes the first program specified.  When the
  54. first program specified terminates, an optional second program will execute.
  55.  
  56. Command Syntax:
  57.  
  58.    LOGRUN [/d][path]program.ext [parameters] [|[path]program.ext [parameters]]
  59.  
  60.  
  61. A novell login script might look something like this:
  62.  
  63.    #SYS:PUBLIC\LOGRUN sys:public\menu.exe %LOGIN_NAME
  64.  
  65.                        - or -
  66.  
  67.    #SYS:PUBLIC\LOGRUN sys:public\menu.exe %LOGIN_NAME | sys:public\logout.exe
  68.  
  69. In the first example, LOGRUN will invoke Novell's menuing utility, passing it
  70. the user's login name as the name of the menu file to use.  In the second
  71. example the same thing happens, but additionally the user is logged out
  72. automatically when the menu utility terminates.
  73.  
  74. Note that LOGRUN must be told both the filename AND THE EXTENSION of the
  75. program it is supposed to run when LOGIN.EXE terminates.  Parameters normally
  76. given to the program would then follow the program's name.
  77.  
  78. If the /D switch is given (which must be the first parameter encountered),
  79. LOGRUN will not load and stay resident if a copy of dCOM is already loaded.
  80. This allows you to have some users (who use dCOM normally as their front end)
  81. invoke the network menuing macro from a local macro key, but for other users
  82. not using dCOM, load dCOM and invoke your menuing macros from the login script.
  83.  
  84. Note: A technical anamoly has been encountered on occassion when calling the
  85.       Novell LOGOUT.EXE program from LOGRUN without any parameters.  LOGOUT
  86.       sometimes doesn't parse the command line properly (this may be associated
  87.       with an odd behaviour of LOGIN.EXE when it runs a program in that it
  88.       passes a null terminated command line instead of a CR terminated like
  89.       Dos does).  In any event, if you see this behaviour and don't want to
  90.       explicitly give a file server name after the LOGOUT.EXE command, using
  91.       an asterick will accomplish the same effect of logging out of all file
  92.       servers and fix the problem.
  93.  
  94.       For example:
  95.  
  96.    #SYS:PUBLIC\LOGRUN sys:public\menu.exe %LOGIN_NAME | sys:public\logout.exe *
  97.  
  98.  
  99.  
  100.                                                           Dave Frailey
  101.                                                           September 1990
  102.  
  103.                                                           DAC Micro Systems
  104.                                                           40941 176th St E
  105.                                                           Lancaster, CA  93535
  106.  
  107.                                                           Voice: 805/264-1700
  108.                                                           Data:  805/264-1219
  109.  
  110.